import math
from math import cos
from math import sqrt
from math import radians

slen1 = int(input('请输入第一条边的边长：') )
slen2 = int(input('请输入第二条边的边长：'))
ang = int(input('请输入两边的夹角（角度制）：'))
fang = radians(ang)

slen3 = math.sqrt(slen1**2 + slen2**2 - 2*slen1*slen2*cos(fang))
print(format(slen3,'.4f'))